//方法的类型注解(参数和返回值)与函数用法相同
class Point {
    x = 10
    y = 20
    sale(n:number) {
        this.x *= n
        this.y *= n
    }
}
let p = new Point()
p.sale(10)
console.log(p.x,p.y) // 100 200
